package com.imooc.dto.address;

import com.imooc.common.constants.ResultCodeConstants;
import com.imooc.common.exception.ValidateException;
import com.imooc.common.result.AbstractRequest;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

/**
 * @ClassName: AddressListRequest
 * @Description: 用户收货地址列表请求
 * @author: limingxing
 * @Date: 2019-12-25 10:43
 */
@Data
@ApiModel(value = "用户收货地址列表请求参数")
public class AddressListRequest extends AbstractRequest {

    @ApiModelProperty(value = "用户ID",required = true)
    private String userId;

    @Override
    public void requestCheck() {
        if (StringUtils.isBlank(userId) ) {
            throw new ValidateException(ResultCodeConstants.REQUISITE_PARAMETER_NOT_EXIST.getCode(),
                    ResultCodeConstants.REQUISITE_PARAMETER_NOT_EXIST.getMessage());
        }
    }
}
